package com.uam.web.common.vo;

import com.alibaba.fastjson.annotation.JSONField;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

/**
 * @author Administrator
 */
@Data
@ApiModel(value = "点信息")
public class  PointVo {

  public PointVo(List<Object> points){
      this.points=points;
    }

    @JSONField(name = "conflict_point")
    private boolean conflictPoint=false;

    @JSONField(serialize = false)
    private String id;

    public PointVo(){

    }

    public PointVo(boolean conflictPoint, String id, List<Object> points) {
        this.conflictPoint = conflictPoint;
        this.id = id;
        this.points = points;
    }

    public PointVo(TrackPoint trackPoint, boolean flag, String id){

        //经度，纬度，时间戳，速度，海拔高度，通信信号强度，导航信号强度，监控信号强度，安全距离，定位精度，连接基站数量,通信信号数量,导航信号数量,监控信号数量
        List<Object> pointsData=new ArrayList<>();
        //经度 0
        pointsData.add(trackPoint.getPosition()[0]);
        //纬度 1
        pointsData.add(trackPoint.getPosition()[1]);
        //时间戳 2
        pointsData.add(trackPoint.getTime());
        //速度 3
        pointsData.add(trackPoint.getSpeed());
        //海拔高度 4
        pointsData.add(trackPoint.getAltitude());
        //通信信号强度 5
        pointsData.add(trackPoint.getCommunicationSignal());
        //导航信号强度 6
        pointsData.add(trackPoint.getNavigationSignal());
        //监控信号强度 7
        pointsData.add(trackPoint.getSupervisorySignal());
        //安全距离 8
        pointsData.add(trackPoint.getSafeDistance());
        //定位精度 9
        pointsData.add(trackPoint.getPositioningAccuracy());
        //连接基站数量 10
        pointsData.add(trackPoint.getConnNum());
        //通信信号数量 11
        pointsData.add(trackPoint.getCommunicationSignalNum());
        //导航信号数量 12
        pointsData.add(trackPoint.getNavigationSignalNum());
        //监控信号数量 13
        pointsData.add(trackPoint.getSupervisorySignalNum());

        //通信信号位置 14
        pointsData.add(trackPoint.getCommunicationSignalPosition());
        //导航信号位置 15
        pointsData.add(trackPoint.getNavigationSignalPosition());
        //监控信号数量 16
        pointsData.add(trackPoint.getSupervisorySignalPosition());

        pointsData.add(trackPoint.isConflictPoint());


        this.points=pointsData;
        this.conflictPoint=flag;
        this.id=id;
    }


    //    @ApiModelProperty(value = "经纬度")
//    private Double x;
//
//    @ApiModelProperty(value = "纬度")
//    private Double y;
//
//    @ApiModelProperty(value = "时间戳")
//    private Long time;
//
//    @ApiModelProperty(value = "速度")
//    private Integer speed;
//
//    @ApiModelProperty(value = "精度")
//    private double altitude = 0.00D;
//
//    @ApiModelProperty(value = "定位强度")
//    private int communicationSignal = -1;
//
//    @ApiModelProperty(value = "导航强度")
//    private int navigationSignal = -1;
//
//    @ApiModelProperty(value = "监控强度")
//    private int supervisorySignal = -1;
//
//    @ApiModelProperty(value = "安全距离")
//    private double safeDistance = 0.00D;
//
//    @ApiModelProperty(value = "定位精度")
//    private double accuracy = 0.00D;
//
//    @ApiModelProperty(value = "连接数量")
//    private int connNum = 0;
    List<Object> points;
}
